using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace Wrath.CodeBox
{
    public partial class CodeBox
    {
        public class ColorWay : Dictionary<string, Color>
        {

            public ColorWay()
            {
                Clear();
                // add some new colours

                Add("number", Color.Black);
                Add("string", Color.Black);
            }

            public new void Clear()
            {
                base.Clear();

                // restore the standard colours
                Add("identifier", Color.Black);
                Add("whitespace", Color.Black);
                Add("keyword", Color.DarkBlue);
                Add("operator", Color.DarkBlue);
                Add("comment", Color.DarkGreen);
                Add("error", Color.Red);
            }

            public new void Remove(string key)
            {
                // can't remove the standard colours, it just resets the default
                switch (key.ToLower())
                {
                    case "identifier":
                    case "whitespace":
                        this[key] = Color.Black;
                        break;

                    case "keyword":
                    case "operator":
                        this[key] = Color.DarkBlue;
                        break;

                    case "comment":
                        this[key] = Color.DarkGreen;
                        break;

                    case "error":
                        this[key] = Color.Red;
                        break;

                    default:
                        base.Remove(key);
                        break;
                }
            }

        }
    }
}
